package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * ProjectCustomer generated by hbm2java
 */
@Entity
@Table(name = "PROJECT_CUSTOMER", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = {
		@UniqueConstraint(columnNames = "PROJECT_ID"),
		@UniqueConstraint(columnNames = { "PROJECT_ID", "CUSTOMER_ID" }) })
public class ProjectCustomer implements java.io.Serializable {

	private ProjectCustomerId id;
	private Objects objectsByCustomerId;
	private Objects objectsByProjectId;

	public ProjectCustomer() {
	}

	public ProjectCustomer(ProjectCustomerId id, Objects objectsByCustomerId,
			Objects objectsByProjectId) {
		this.id = id;
		this.objectsByCustomerId = objectsByCustomerId;
		this.objectsByProjectId = objectsByProjectId;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "projectId", column = @Column(name = "PROJECT_ID", unique = true, nullable = false)),
			@AttributeOverride(name = "customerId", column = @Column(name = "CUSTOMER_ID", nullable = false)),
			@AttributeOverride(name = "startDate", column = @Column(name = "START_DATE", nullable = false, length = 10)),
			@AttributeOverride(name = "endDate", column = @Column(name = "END_DATE", nullable = false, length = 10)),
			@AttributeOverride(name = "total", column = @Column(name = "TOTAL", nullable = false, precision = 128, scale = 0)) })
	public ProjectCustomerId getId() {
		return this.id;
	}

	public void setId(ProjectCustomerId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMER_ID", nullable = false, insertable = false, updatable = false)
	public Objects getObjectsByCustomerId() {
		return this.objectsByCustomerId;
	}

	public void setObjectsByCustomerId(Objects objectsByCustomerId) {
		this.objectsByCustomerId = objectsByCustomerId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", unique = true, nullable = false, insertable = false, updatable = false)
	public Objects getObjectsByProjectId() {
		return this.objectsByProjectId;
	}

	public void setObjectsByProjectId(Objects objectsByProjectId) {
		this.objectsByProjectId = objectsByProjectId;
	}

}
